package kr.hkit.powerjava.chther08;

class Student {
	private int stdNum;
	private String stdName;


	public int getStdNum() {
		return stdNum;
	}

	public void setStdNum(int stdNum) {
		this.stdNum = stdNum;
	}

	public String getStdName() {
		return stdName;
	}

	public void setStdName(String stdName) {
		if (stdNum > 0) {
			this.stdName = stdName;
		} else {
			this.stdName = stdName;
		}
	}

	@Override
	public String toString() {
		return stdNum + ":" + stdName;
	}

	public void getSum() {
		int sum = 0;
		for (int i = 0; i < 101; i++) {
			sum += i;
			int b=2;
			sum += i+b;
		}
		System.out.println(sum);
	}

}

public class GetSetTest {
	public static void main(String[] args) {
		Student std = new Student();
		std.setStdNum(1);
		std.setStdName("신우석");
		
		Student std2 = new Student();
		std2.setStdNum(1);
		std2.setStdName("신우석");
		Student std3;
		std3 = std2;
		int i =10;
		int j =10;
		
		System.out.println("학번" + std.getStdNum());
		System.out.println("이름" + std.getStdName());
		System.out.println(std);
		std.getSum();
		
		if(std2==std3){
			System.out.println("같음");
		}else{
			System.out.println("다름");
		}
		
		
		if(i==j){
			System.out.println("같음");
		}else{
			System.out.println("다름");
		}
		
		if(std==std2){
			System.out.println("같음");
		}else{
			System.out.println("다름");
		}
		
		if(std.equals(std2)){
			System.out.println("같음");
		}else{
			System.out.println("다름");
		}
		
		
	}
	
	
}
